package com.bwie.dao;


import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.bwie.entity.Article;
import com.bwie.entity.Category;
import com.bwie.entity.QueryVo;
import com.bwie.entity.Channel;

public interface ArticleDao {

	List<Article> list(QueryVo qv);
	@Select("SELECT * FROM cms_channel")
	List<Channel> getAllChannerl();
	@Select("SELECT * FROM cms_category WHERE channel_id=#{cid}")
    List<Category> getCategory(@Param("cid")Integer cid);
	@Insert("INSERT INTO `zhoukaomoni7_22`.`cms_article` (`id`, `title`, `pic`, `channel_id`, `category_id`, `context`) VALUES (null, #{title}, #{pic}, #{channel.id}, #{category.id}, #{context})")
	void add(Article a);
}
